<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div style="background-color: #f3f3f3">
	<div class="container">
		<c:url value="/project/list" var="action" />
			<form:form action="${action }" method="post" modelAttribute="borrowForm" id="borrowForm">
			<form:hidden path="model"/>
			<form:hidden path="status"/>
			<form:hidden path="cycle"/>
			<form:hidden path="profit"/>
			<div class="panel panel-default">
				<div class="panel-body">
					<ul class="list-unstyled borrow_search" id="borrow_search">
						<li>
							<dl>
								<dt>项目类型:</dt>
								<dd>
									<ul class="list-inline">
										<c:forEach items="${models}" var="name" varStatus="status">
											<c:choose>
												<c:when test="${status.index eq borrowForm.model}">
												<li><a href="#" data-field="model" data-value="${status.index}" class="action">${name}</a></li>
												</c:when>
												<c:otherwise>
												<li><a href="#" data-field="model" data-value="${status.index}">${name}</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</ul>
								</dd>
							</dl>
						</li>
						<li>
							<dl>
								<dt>项目类型:</dt>
								<dd>
									<ul class="list-inline">
										<c:forEach items="${status}" var="name" varStatus="status">
											<c:choose>
												<c:when test="${status.index eq borrowForm.status}">
												<li><a href="#" data-field="status" data-value="${status.index}" class="action">${name}</a></li>
												</c:when>
												<c:otherwise>
												<li><a href="#" data-field="status" data-value="${status.index}">${name}</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</ul>
								</dd>
							</dl>
						</li>
						<li>
							<dl>
								<dt>项目周期:</dt>
								<dd>
									<ul  class="list-inline">
										<c:forEach items="${cycles}" var="name" varStatus="status">
											<c:choose>
												<c:when test="${status.index eq borrowForm.cycle}">
												<li><a href="#" data-field="cycle" data-value="${status.index}" class="action">${name}</a></li>
												</c:when>
												<c:otherwise>
												<li><a href="#" data-field="cycle" data-value="${status.index}">${name}</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</ul>
								</dd>
							</dl>
						</li>
						<li>
							<dl>
								<dt>项目收益:</dt>
								<dd>
									<ul class="list-inline">
										<c:forEach items="${profits}" var="name" varStatus="status">
											<c:choose>
												<c:when test="${status.index eq borrowForm.profit}">
												<li><a href="#" data-field="profit" data-value="${status.index}" class="action">${name}</a></li>
												</c:when>
												<c:otherwise>
												<li><a href="#" data-field="profit" data-value="${status.index}">${name}</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</ul>
								</dd>
							</dl>
						</li>
					</ul>
				</div>
			</div>
		</form:form>
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#borrow_search a").click(function(){
				var $this = $(this);
				var id = $this.attr("data-field");
				$("#"+id).val($this.attr("data-value"));
				$("#borrowForm").submit();
			});
		});
	</script>
	
	<c:forEach begin="0" end="8">
	<div class="container">
		<div class="panel panel-default">
			<div class="panel-body borrow-list-body">
				<div class="page-header">
					<h4><a href="#">月月盈2016091001（赎楼过桥）</a></h4>
				</div>
				<div class="row borrow-list-margin">
					<div class="col-md-2">
						<span class="text-muted">年化收益率</span>
						<p class="text-danger">6%</p>
						<span class="text-muted">还款方式</span>
						<p class="text-danger">到期一次性还本付息</p>
					</div>
					<div class="col-md-1">
						<span class="text-muted">投资期限</span>
						<p class="text-danger">3个月</p>
						<span class="text-muted">投资笔数</span>
						<p class="text-danger">72</p>
					</div>
					<div class="col-md-2">
						<span class="text-muted">借款金额</span>
						<p class="text-danger">830,000.00元</p>
						<span class="text-muted">合作机构</span>
						<p class="text-danger">信必隆</p>
					</div>
					<div class="col-md-2">
						<span class="text-muted">可投资金额</span>
						<p class="text-danger">830,000.00元</p>
						<span class="text-muted">发布时间</span>
						<p class="text-danger">2016-09-12</p>
					</div>
					<div class="col-md-3" style="padding-top: 50px">
						<div class="progress" >
						  <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
						    60%
						  </div>
						</div>
					</div>
					<div class="col-md-2" style="padding-top:40px;">
						<a href="#" class="btn btn-primary btn-block btn-sm">投资</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	</c:forEach>
</div>
